package zzcltw.com.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.StringUtil;

import zzcltw.com.mapper.HomePageMapper;
import zzcltw.com.service.IHomePageService;
import zzcltw.com.service.common.impl.BaseServiceImpl;


@Service("homePageService")
public class HomePageServiceImpl extends BaseServiceImpl implements IHomePageService{
	@Autowired
    private HomePageMapper homePageMapper;
	/**
	 * 
	 * @Title  公司介绍查询
	 * @Description:  homeCompanyInfo
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月15日
	 */
	public Map<String,Object> homeCompanyInfo(Map<String,String> map){
		Map<String,String> bean = homePageMapper.homeCompanyInfo(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", "");
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 董事长信息
	 * @Description:  homePersonInfo
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月15日
	 */
	public Map<String,Object> homePersonInfo(Map<String,String> map){
		Map<String,String> bean = homePageMapper.homePersonInfo(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", "");
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 产品详情
	 * @Description:  homeProductDtlById
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月28日
	 */
	public Map<String,Object> homeProductDtlById(Map<String,String> map){
		String productId = map.get("productId");
		if(StringUtil.isEmpty(productId)){
			Map<String,Object> map1 = new HashMap<>();
			Map<String,String> bean = new HashMap<>();
			bean.put("rtnCd", "9999");
			bean.put("rtnMsg", "产品ID不能为空");
			map1.put("beans", "");
			map1.put("bean", bean);
			map1.put("busiCode", "");
	    	map1.put("returnCode", "0");
	    	map1.put("returnMessage", "");
	    	map1.put("object", "");
	    	map1.put("busiCode", ""); 
			return map1;
		}
		Map<String,String> bean = homePageMapper.homeProductDtlById(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", "");
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 项目详情
	 * @Description:  homeInvestDtlById
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月28日
	 */
	public Map<String,Object> homeInvestDtlById(Map<String,String> map){
		String investId = map.get("investId");
		if(StringUtil.isEmpty(investId)){
			Map<String,Object> map1 = new HashMap<>();
			Map<String,String> bean = new HashMap<>();
			bean.put("rtnCd", "9999");
			bean.put("rtnMsg", "项目ID不能为空");
			map1.put("beans", "");
			map1.put("bean", bean);
			map1.put("busiCode", "");
	    	map1.put("returnCode", "0");
	    	map1.put("returnMessage", "");
	    	map1.put("object", "");
	    	map1.put("busiCode", ""); 
			return map1;
		}
		Map<String,String> bean = homePageMapper.homeInvestDtlById(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", "");
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 产品列表
	 * @Description:  homeProductList
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeProductList(Map<String,String> map){
		List<Map<String,String>> list = homePageMapper.homeProductList(map);
		int count = homePageMapper.homeProductListCount(map);
		Map<String,String> bean = new HashMap<>();
		bean.put("total", Integer.toString(count));
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", list);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 新闻列表
	 * @Description:  homeNewsList
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeNewsList(Map<String,String> map){
		List<Map<String,String>> list = homePageMapper.homeNewsList(map);
		int count = homePageMapper.homeNewsListCount(map);
		Map<String,String> bean = new HashMap<>();
		bean.put("total", Integer.toString(count));
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", list);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 新闻详情
	 * @Description:  homeNewsDtlById
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeNewsDtlById(Map<String,String> map){
		Map<String,String> bean = homePageMapper.homeNewsDtlById(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", null);
		map1.put("bean", bean);
		map1.put("busiCode", "");
		map1.put("returnCode", "0");
		map1.put("returnMessage", "");
		map1.put("object", "");
		map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 项目列表
	 * @Description:  homeInvestList
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeInvestList(Map<String,String> map){
		List<Map<String,String>> list = homePageMapper.homeInvestList(map);
		int count = homePageMapper.homeInvestListCount(map);
		Map<String,String> bean = new HashMap<>();
		bean.put("total", Integer.toString(count));
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", list);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 招商会列表
	 * @Description:  homeInvestMeetList
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeInvestMeetList(Map<String,String> map){
		List<Map<String,String>> list = homePageMapper.homeInvestMeetList(map);
		int count = homePageMapper.homeInvestMeetListCount(map);
		Map<String,String> bean = new HashMap<>();
		bean.put("total", Integer.toString(count));
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", list);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title 招聘信息列表
	 * @Description:  homeRecruitList
	 * @param:  Map<String,String>
	 * @param: 
	 * @return Map<String,Object>
	 * @throws
	 * @author zzx
	 * @Date 2018年8月23日
	 */
	public Map<String,Object> homeRecruitList(Map<String,String> map){
		List<Map<String,String>> list = homePageMapper.homeRecruitList(map);
		int count = homePageMapper.homeRecruitListCount(map);
		Map<String,String> bean = new HashMap<>();
		bean.put("total", Integer.toString(count));
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", list);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
	/**
	 * 
	 * @Title  招聘信息详情
	 * @Description:  recruitDtlInfoById
	 * @param: @param map
	 * @param: @return
	 * @return 
	 * @throws
	 * @author zzx
	 * @Date 2018年9月7日
	 */
	public Map<String,Object> recruitDtlInfoById(Map<String,String> map){
		Map<String,String> bean = homePageMapper.recruitDtlInfoById(map);
		Map<String,Object> map1 = new HashMap<>();
		map1.put("beans", null);
		map1.put("bean", bean);
		map1.put("busiCode", "");
    	map1.put("returnCode", "0");
    	map1.put("returnMessage", "");
    	map1.put("object", "");
    	map1.put("busiCode", ""); 
		return map1;
	}
}
